<?php if (!defined('HOST')) die('not access'); ?>
<script>
    $(document).ready(function () {

        var barr = {};
        var c = {
            init: function () {
                this.loadys();
                js.ajax(js.getajaxurl('getinfo', '{mode}', '{dir}'), {}, function (a) {

                    barr = a;
                    for (var i in a) $('#' + i + '_{rand}').val(a[i]);
                    if (a.isshou == '1') $('#benquan_{rand}').html('<font color=green>授权版</font>');
                    //if (isempt(a.asyntest)) get('asynsend_{rand}').length = 1;
                }, 'get,json');
            },
            loadys: function () {
                if (!get('defstype_{rand}')) return;
                var ysarr = 'cerulean,cosmo,cyborg,darkly,flatly,journal,lumen,paper,readable,sandstone,simplex,slate,spacelab,superhero,united,xinhu,yeti';
                var sear = ysarr.split(','), i, len = sear.length, das = [];
                for (i = 0; i < len; i++) {
                    das.push({name: sear[i], value: i + 1});
                    das.push({name: sear[i] + '_def', value: i + 1 + len});
                }
                js.setselectdata(get('defstype_{rand}'), das, 'value');
            },
            save: function (o) {
                var d = {};
                for (var i in barr) {
                    d[i] = $('#' + i + '_{rand}').val();
                }
                if (d.title == '') {
                    js.msg('msg', '系统标题不能为空');
                    return;
                }

                js.ajax(js.getajaxurl('savewater', '{mode}', '{dir}'), d, function (s) {
                    if (s != 'ok') js.msg('msg', s);
                }, 'post', false, '保存中...,保存成功');
            },
            blurls: function (o) {
                var val = strreplace(o.value);
                if (val == '') return;
                var la = val.substr(val.length - 1);
                if (la != '/') val += '/';
                o.value = val;
            }
        };
        js.initbtn(c);
        c.init();

        $('#url_{rand}').blur(function () {
            c.blurls(this);
        });
        $('#localurl_{rand}').blur(function () {
            c.blurls(this);
        });
    });
</script>

<div align="left">
    <div style="padding:10px;">

        <table cellspacing="0" width="900" border="0" cellpadding="0">

            <tr>
                <td colspan="4">
                    <div class="inputtitle">水印设置
                        <div style="padding:5px;line-height:18px;font-size:12px;color:#888888">

                        </div>
                    </div>
                </td>
            </tr>

            <tr>
                <td align="right" width="15%" width="180">水印内容：</td>
                <td class="tdinput" width="35%"><input id="watermark_txt_{rand}" placeholder="不填默认无水印"
                                                       class="form-control">
                </td>
                <td align="right" width="15%">水印字体：</td>
                <td class="tdinput" width="35%"><input id="watermark_font_{rand}" placeholder="不填默认字体:微软雅黑"
                                                       class="form-control">
                </td>
            </tr>

            <tr>
                <td align="right">水印x轴间隔：</td>
                <td class="tdinput"><input id="watermark_x_space_{rand}" placeholder="不填默认x轴间隔:10" class="form-control">
                </td>
                <td align="right">水印y轴间隔：</td>
                <td class="tdinput"><input id="watermark_y_space_{rand}" placeholder="不填默认y轴间隔:10" class="form-control">
                </td>
            </tr>

            <tr>
                <td align="right">水印字体大小：</td>
                <td class="tdinput"><input id="watermark_fontsize_{rand}" placeholder="不填默认字体大小:18px"
                                           class="form-control">
                </td>
                <td align="right">水印字体颜色：</td>
                <td class="tdinput"><input id="watermark_color_{rand}" placeholder="不填默认颜色:black" class="form-control">
                </td>
            </tr>

            <tr>
                <td align="right">水印宽度：</td>
                <td class="tdinput"><input id="watermark_width_{rand}" placeholder="不填默认宽度:180" class="form-control">
                </td>
                <td align="right">水印高度：</td>
                <td class="tdinput"><input id="watermark_height_{rand}" placeholder="不填默认高度:80" class="form-control">
                </td>
            </tr>
            <tr>
                <td align="right">水印透明度(0.005,1)：</td>
                <td class="tdinput"><input id="watermark_alpha_{rand}" placeholder="不填默认透明度:0.2" class="form-control">
                </td>
            </tr>
            <tr>
                <td align="right">水印倾斜度数(0,90)：</td>
                <td class="tdinput"><input id="watermark_angle_{rand}" placeholder="不填默认倾斜度:10" class="form-control">
                </td>
            </tr>

            <tr>
                <td align="right"></td>
                <td style="padding:15px 0px" colspan="3" align="left">
                    <button click="save" class="btn btn-success" type="button"><i class="icon-save"></i>&nbsp;保存
                    </button>
                </td>
            </tr>

        </table>
    </div>
</div>